package com.starlink.model.util;

import com.starlink.model.dtomapper.MallBooksSpecificationDtoMapper;
import com.starlink.model.domain.MallBooksSpecificationDO;
import com.starlink.model.vo.MallBooksSpecificationVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class MallBooksSpecificationConvert {

    public static List<MallBooksSpecificationVO> buildMallBooksSpecificationVoList(List<MallBooksSpecificationDO> mallBooksSpecificationDOList) {
        if (CollectionUtils.isEmpty(mallBooksSpecificationDOList)) {
            return Lists.newArrayList();
        }
        List<MallBooksSpecificationVO> mallBooksSpecificationVOList = new ArrayList<>();
        for (MallBooksSpecificationDO mallBooksSpecificationDO : mallBooksSpecificationDOList) {
            mallBooksSpecificationVOList.add(MallBooksSpecificationDtoMapper.INSTANCE.do2VO(mallBooksSpecificationDO));
        }

        return mallBooksSpecificationVOList;
    }
}
